package com.xuelang.pipeline.app.application.converter;

import com.xuelang.pipeline.client.application.dto.ComponentDTO;
import com.xuelang.pipeline.domain.application.Component;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

/**
 * 组件DTO与组件实体转换器
 *
 * @author xiwen.zxg
 * @since 2024/5/15
 */
@Mapper
public interface ComponentDTOToComponentConverter {
    ComponentDTOToComponentConverter INSTANCE = Mappers.getMapper(ComponentDTOToComponentConverter.class);

    /**
     * Component转化为ComponentDTO
     * @param component
     * @return
     */
    ComponentDTO componentToComponentDTO(Component component);

    /**
     * ComponentDTO转化为Component
     * @param componentDTO
     * @return
     */
    Component componentDTOToComponent(ComponentDTO componentDTO);
}
